<script setup lang="ts">
	import { getHotelDetail } from '@/api/Hotel'
	import { onMounted, ref } from 'vue';
	const query = defineProps<{
		id ?: number | string,
		destinationId ?: number | string,
	}>()
	const detailContent = ref('')
	onMounted(() => {
		initData()
	})
	
	const initData = async () => {
		const { data } = await getHotelDetail(query.id, { destinationId: query.destinationId })
		detailContent.value = data 
		
	}
</script>

<template>
	<view class="service-panel">
		<view class="content">
			<view class="item" v-for="item in detailContent.contents">
				<view class="dt">{{item.title}}</view>
				<view class="dd">
					<view v-html="item.contents[0]">
						
					</view>
				</view>
			</view>
			<view class="item" v-for="item in detailContent.policies">
				<view class="dt">{{item.title}}</view>
				<view class="dd">
					<view v-html="item.contents[0]">
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<style lang="scss">
	.service-panel {
		width: 90vw;
		padding: 0 30rpx;
		border-radius: 20rpx;
		position: relative;
		background-color: #fff;
	}

	.title {
		line-height: 1;
		padding: 40rpx 0;
		text-align: center;
		font-size: 32rpx;
		font-weight: normal;
		border-bottom: 1rpx solid #ddd;
		color: #444;
	}

	.close {
		position: absolute;
		right: 24rpx;
		top: 24rpx;
	}

	.content {
		padding: 20rpx;

		.item {
			margin-top: 20rpx;
		}

		.dt {
			margin-bottom: 10rpx;
			font-size: 28rpx;
			color: #333;
			font-weight: 500;
			position: relative;

			&::before {
				content: '';
				width: 10rpx;
				height: 10rpx;
				border-radius: 50%;
				background-color: #eaeaea;
				transform: translateY(-50%);
				position: absolute;
				top: 50%;
				left: -20rpx;
			}
		}

		.dd {
			line-height: 1.6;
			font-size: 26rpx;
			color: #999;
		}
	}
</style>